home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-04-18 | 12.9 KB | 588 lines | [TEXT/MPS ] |
- ;
- ; File: Icons.a
- ;
- ; Contains: Icon Utilities Interfaces.
- ;
- ; Version: Technology: System 7.5
- ; Package: Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
- ;
- ; Copyright: © 1984-1995 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- ; stack. Include the file and version information (from above)
- ; in the problem description and send to:
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__ICONS__') = 'UNDEFINED' THEN
- __ICONS__ SET 1
-
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
- include 'Quickdraw.a'
- ENDIF
- ; include 'MixedMode.a' ;
- ; include 'QuickdrawText.a' ;
-
- ; The following are icons for which there are both icon suites and SICNs.
- genericDocumentIconResource EQU -4000
- genericStationeryIconResource EQU -3985
- genericEditionFileIconResource EQU -3989
- genericApplicationIconResource EQU -3996
- genericDeskAccessoryIconResource EQU -3991
- genericFolderIconResource EQU -3999
- privateFolderIconResource EQU -3994
- floppyIconResource EQU -3998
- trashIconResource EQU -3993
- ; The following are icons for which there are SICNs only.
- desktopIconResource EQU -3992
- openFolderIconResource EQU -3997
- genericHardDiskIconResource EQU -3995
- genericFileServerIconResource EQU -3972
- genericSuitcaseIconResource EQU -3970
- genericMoverObjectIconResource EQU -3969
- ; The following are icons for which there are icon suites only.
- genericPreferencesIconResource EQU -3971
- genericQueryDocumentIconResource EQU -16506
- genericExtensionIconResource EQU -16415
- systemFolderIconResource EQU -3983
- appleMenuFolderIconResource EQU -3982
-
- startupFolderIconResource EQU -3981
- ownedFolderIconResource EQU -3980
- dropFolderIconResource EQU -3979
- sharedFolderIconResource EQU -3978
- mountedFolderIconResource EQU -3977
- controlPanelFolderIconResource EQU -3976
- printMonitorFolderIconResource EQU -3975
- preferencesFolderIconResource EQU -3974
- extensionsFolderIconResource EQU -3973
- fontsFolderIconResource EQU -3968
- fullTrashIconResource EQU -3984
- large1BitMask EQU 'ICN#'
- large4BitData EQU 'icl4'
- large8BitData EQU 'icl8'
- small1BitMask EQU 'ics#'
- small4BitData EQU 'ics4'
- small8BitData EQU 'ics8'
- mini1BitMask EQU 'icm#'
- mini4BitData EQU 'icm4'
- mini8BitData EQU 'icm8'
-
- ; alignment type values
- atNone EQU $0
- atVerticalCenter EQU $1
- atTop EQU $2
- atBottom EQU $3
- atHorizontalCenter EQU $4
- atAbsoluteCenter EQU atVerticalCenter | atHorizontalCenter
- atCenterTop EQU atTop | atHorizontalCenter
- atCenterBottom EQU atBottom | atHorizontalCenter
- atLeft EQU $8
- atCenterLeft EQU atVerticalCenter | atLeft
- atTopLeft EQU atTop | atLeft
- atBottomLeft EQU atBottom | atLeft
- atRight EQU $C
- atCenterRight EQU atVerticalCenter | atRight
- atTopRight EQU atTop | atRight
- atBottomRight EQU atBottom | atRight
-
- ; typedef short IconAlignmentType
- ; transform type values
-
- ttNone EQU $0
- ttDisabled EQU $1
- ttOffline EQU $2
- ttOpen EQU $3
- ttLabel1 EQU $0100
- ttLabel2 EQU $0200
- ttLabel3 EQU $0300
- ttLabel4 EQU $0400
- ttLabel5 EQU $0500
- ttLabel6 EQU $0600
- ttLabel7 EQU $0700
- ttSelected EQU $4000
- ttSelectedDisabled EQU ttSelected | ttDisabled
- ttSelectedOffline EQU ttSelected | ttOffline
- ttSelectedOpen EQU ttSelected | ttOpen
-
- ; typedef short IconTransformType
- ; Selector mask values
-
- svLarge1Bit EQU $00000001
- svLarge4Bit EQU $00000002
- svLarge8Bit EQU $00000004
- svSmall1Bit EQU $00000100
- svSmall4Bit EQU $00000200
- svSmall8Bit EQU $00000400
- svMini1Bit EQU $00010000
- svMini4Bit EQU $00020000
- svMini8Bit EQU $00040000
- svAllLargeData EQU $000000ff
- svAllSmallData EQU $0000ff00
- svAllMiniData EQU $00ff0000
- svAll1BitData EQU svLarge1Bit | svSmall1Bit | svMini1Bit
- svAll4BitData EQU svLarge4Bit | svSmall4Bit | svMini4Bit
- svAll8BitData EQU svLarge8Bit | svSmall8Bit | svMini8Bit
- svAllAvailableData EQU $ffffffff
-
- ; typedef unsigned long IconSelectorValue
- ; typedef IconActionProcPtr IconAction
- ; typedef IconGetterProcPtr IconGetter
- IF ¬ OLDROUTINELOCATIONS THEN
- CIcon RECORD 0
- iconPMap ds PixMap ; offset: $0 (0) ;the icon's pixMap
- iconMask ds BitMap ; offset: $32 (50) ;the icon's mask
- iconBMap ds BitMap ; offset: $40 (64) ;the icon's bitMap
- iconData ds.l 1 ; offset: $4E (78) ;the icon's data
- iconMaskData ds.w 1 ; offset: $52 (82) ;icon's mask and BitMap data
- sizeof EQU * ; size: $54 (84)
- ENDR
-
- ; typedef struct CIcon CIcon, *CIconPtr, **CIconHandle
- ;
- ; pascal CIconHandle GetCIcon(short iconID)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetCIcon: OPWORD $AA1E
- ELSE
- IMPORT_CFM_FUNCTION GetCIcon
- ENDIF
-
- ;
- ; pascal void PlotCIcon(const Rect *theRect, CIconHandle theIcon)
- ;
- IF ¬ GENERATINGCFM THEN
- _PlotCIcon: OPWORD $AA1F
- ELSE
- IMPORT_CFM_FUNCTION PlotCIcon
- ENDIF
-
- ;
- ; pascal void DisposeCIcon(CIconHandle theIcon)
- ;
- IF ¬ GENERATINGCFM THEN
- _DisposeCIcon: OPWORD $AA25
- ELSE
- IMPORT_CFM_FUNCTION DisposeCIcon
- ENDIF
-
- ;
- ; pascal Handle GetIcon(short iconID)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetIcon: OPWORD $A9BB
- ELSE
- IMPORT_CFM_FUNCTION GetIcon
- ENDIF
-
- ;
- ; pascal void PlotIcon(const Rect *theRect, Handle theIcon)
- ;
- IF ¬ GENERATINGCFM THEN
- _PlotIcon: OPWORD $A94B
- ELSE
- IMPORT_CFM_FUNCTION PlotIcon
- ENDIF
-
- ENDIF
- ;
- ; pascal OSErr PlotIconID(const Rect *theRect, IconAlignmentType align, IconTransformType transform, short theResID)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _PlotIconID
- move.w #$0500,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION PlotIconID
- ENDIF
-
- ;
- ; pascal OSErr NewIconSuite(Handle *theIconSuite)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _NewIconSuite
- move.w #$0207,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION NewIconSuite
- ENDIF
-
- ;
- ; pascal OSErr AddIconToSuite(Handle theIconData, Handle theSuite, ResType theType)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AddIconToSuite
- move.w #$0608,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AddIconToSuite
- ENDIF
-
- ;
- ; pascal OSErr GetIconFromSuite(Handle *theIconData, Handle theSuite, ResType theType)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetIconFromSuite
- move.w #$0609,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetIconFromSuite
- ENDIF
-
- ;
- ; pascal OSErr ForEachIconDo(Handle theSuite, IconSelectorValue selector, IconActionUPP action, void *yourDataPtr)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _ForEachIconDo
- move.w #$080A,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION ForEachIconDo
- ENDIF
-
- ;
- ; pascal OSErr GetIconSuite(Handle *theIconSuite, short theResID, IconSelectorValue selector)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetIconSuite
- move.w #$0501,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetIconSuite
- ENDIF
-
- ;
- ; pascal OSErr DisposeIconSuite(Handle theIconSuite, Boolean disposeData)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _DisposeIconSuite
- move.w #$0302,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION DisposeIconSuite
- ENDIF
-
- ;
- ; pascal OSErr PlotIconSuite(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIconSuite)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _PlotIconSuite
- move.w #$0603,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION PlotIconSuite
- ENDIF
-
- ;
- ; pascal OSErr MakeIconCache(Handle *theHandle, IconGetterUPP makeIcon, void *yourDataPtr)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _MakeIconCache
- move.w #$0604,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION MakeIconCache
- ENDIF
-
- ;
- ; pascal OSErr LoadIconCache(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIconCache)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _LoadIconCache
- move.w #$0606,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION LoadIconCache
- ENDIF
-
- ;
- ; pascal OSErr PlotIconMethod(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconGetterUPP theMethod, void *yourDataPtr)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _PlotIconMethod
- move.w #$0805,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION PlotIconMethod
- ENDIF
-
- ;
- ; pascal OSErr GetLabel(short labelNumber, RGBColor *labelColor, Str255 labelString)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetLabel
- move.w #$050B,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetLabel
- ENDIF
-
- ;
- ; pascal Boolean PtInIconID(Point testPt, const Rect *iconRect, IconAlignmentType align, short iconID)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _PtInIconID
- move.w #$060D,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION PtInIconID
- ENDIF
-
- ;
- ; pascal Boolean PtInIconSuite(Point testPt, const Rect *iconRect, IconAlignmentType align, Handle theIconSuite)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _PtInIconSuite
- move.w #$070E,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION PtInIconSuite
- ENDIF
-
- ;
- ; pascal Boolean PtInIconMethod(Point testPt, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _PtInIconMethod
- move.w #$090F,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION PtInIconMethod
- ENDIF
-
- ;
- ; pascal Boolean RectInIconID(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, short iconID)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _RectInIconID
- move.w #$0610,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION RectInIconID
- ENDIF
-
- ;
- ; pascal Boolean RectInIconSuite(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, Handle theIconSuite)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _RectInIconSuite
- move.w #$0711,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION RectInIconSuite
- ENDIF
-
- ;
- ; pascal Boolean RectInIconMethod(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _RectInIconMethod
- move.w #$0912,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION RectInIconMethod
- ENDIF
-
- ;
- ; pascal OSErr IconIDToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, short iconID)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _IconIDToRgn
- move.w #$0613,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION IconIDToRgn
- ENDIF
-
- ;
- ; pascal OSErr IconSuiteToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, Handle theIconSuite)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _IconSuiteToRgn
- move.w #$0714,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION IconSuiteToRgn
- ENDIF
-
- ;
- ; pascal OSErr IconMethodToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _IconMethodToRgn
- move.w #$0915,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION IconMethodToRgn
- ENDIF
-
- ;
- ; pascal OSErr SetSuiteLabel(Handle theSuite, short theLabel)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SetSuiteLabel
- move.w #$0316,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SetSuiteLabel
- ENDIF
-
- ;
- ; pascal short GetSuiteLabel(Handle theSuite)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetSuiteLabel
- move.w #$0217,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetSuiteLabel
- ENDIF
-
- ;
- ; pascal OSErr GetIconCacheData(Handle theCache, void **theData)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetIconCacheData
- move.w #$0419,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetIconCacheData
- ENDIF
-
- ;
- ; pascal OSErr SetIconCacheData(Handle theCache, void *theData)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SetIconCacheData
- move.w #$041A,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SetIconCacheData
- ENDIF
-
- ;
- ; pascal OSErr GetIconCacheProc(Handle theCache, IconGetterUPP *theProc)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetIconCacheProc
- move.w #$041B,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetIconCacheProc
- ENDIF
-
- ;
- ; pascal OSErr SetIconCacheProc(Handle theCache, IconGetterUPP theProc)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SetIconCacheProc
- move.w #$041C,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SetIconCacheProc
- ENDIF
-
- ;
- ; pascal OSErr PlotIconHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIcon)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _PlotIconHandle
- move.w #$061D,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION PlotIconHandle
- ENDIF
-
- ;
- ; pascal OSErr PlotSICNHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theSICN)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _PlotSICNHandle
- move.w #$061E,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION PlotSICNHandle
- ENDIF
-
- ;
- ; pascal OSErr PlotCIconHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, CIconHandle theCIcon)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _PlotCIconHandle
- move.w #$061F,d0
- dc.w $ABC9
- EndM
- ELSE
- IMPORT_CFM_FUNCTION PlotCIconHandle
- ENDIF
-
- ENDIF ; __ICONS__
-